<?php
require 'settings.php';
require 'db.php';
?>

<html>
<head>
<title><?php echo $corp_name?> Industry Manager - Corporate facilities</title>

<style type="text/css">
table, th, td
{
border: 1px solid black;
border-collapse: collapse;
padding: 5px;
}
</style>

</head>
<body>
<h1 class=c_page_title>Corporate facilities</h1>
<table>
<tr><td style="font-weight:bold">Facility name</td><td style="font-weight:bold">Material multiplier</td><td style="font-weight:bold">Time multiplier</td><td style="font-weight:bold">Installation cost</td><td style="font-weight:bold">Per hour cost</td><td style="font-weight:bold">Facility type</td></tr>

<?php
//facility_id, name, material_multiplier, time_multiplier, installation_cost, per_hour_cost, facility_type
$get_all_facilities->bind_result( $facility_id, $name, $material_multiplier, $time_multiplier, $installation_cost, $per_hour_cost, $facility_type );
$get_all_facilities->execute();

while( $get_all_facilities->fetch() )
{
	$output = '<tr><td>'.$name.'</td><td>'.$material_multiplier.'</td><td>'.$time_multiplier.'</td><td>'.number_format($installation_cost, 2, '.', ',').'</td><td>'.number_format($per_hour_cost, 2, '.', ',').'</td><td>'.$facility_type.'</td></tr>';
	echo $output;
}

$get_all_facilities->close();
?>
</table>

<br />
<a href="edit_facilities.php">Edit facilities</a><br />
<a href="index.php">Back to main screen</a>
</body>
</html>